package com.hmall.mapper;

import com.hmall.model.MallPrice;
import com.hmall.util.MyMapper;
import com.hmall.vo.GradeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
@Repository
public interface MallPriceMapper extends MyMapper<MallPrice> {
    BigDecimal selectPriceNum(@Param(value = "productId") Integer productId,@Param(value = "weight") BigDecimal weight, @Param("grade") String grade);
    //取那样单价
    BigDecimal selectPriceNumSample(@Param(value = "productId") Integer productId, @Param("grade") String grade);
    List<MallPrice> findPriceList(@Param("productId") Integer productId);


    List<String> findGradeListByProductId(@Param("productId")Integer productId);

    List<String> findGradeListByProductIdStr(@Param("list") List productId);

    List<MallPrice> findPriceAndGradeList(@Param("productId") Integer productId, @Param("grade") String grade);

    List<MallPrice> findPriceListByProductIdAndGrade(@Param("productId") Integer productId, @Param("grade") String grade);

    void deleteByProductId(Integer product_id);

    void deleteByGradeAndId(@Param("grade") String grade, @Param("product_id") Integer product_id);

    List<GradeVo> selectGrade(@Param("product_id") Integer product_id);

    String[] selectGradeById(@Param("product_id") Integer product_id);

    MallPrice selectByIdAndGrade(@Param("product_id")Integer product_id,@Param("grade") String grade);
}